package com.tencreat.service.account;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.domain.model.LoginUser;
import com.tencreat.common.core.domain.model.ReqIdParam;
import com.tencreat.common.core.domain.model.ReqIdsParam;
import com.tencreat.common.core.domain.model.ReqPageParam;
import com.tencreat.common.enums.CityIntegralTypeEnum;
import com.tencreat.domain.account.MallUser;
import com.tencreat.domain.account.vo.*;
import com.tencreat.domain.account.dto.MallMessageDTO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 用户Service接口
 *
 * @author tencreat
 * @date 2021-08-13
 */
public interface IMallUserService extends IService<MallUser> {
	/**
	 * 查询用户
	 *
	 * @param id
	 *            用户ID
	 * @return 用户
	 */
	public MallUser selectMallUserById(ReqIdParam id);

	/**
	 * 查询用户列表
	 *
	 * @param mallUser
	 *            用户
	 * @return 用户集合
	 */
	public List<MallUser> selectMallUserList(MallUser mallUser);

	/**
	 * 新增用户
	 *
	 * @param mallUser
	 *            用户
	 * @return 结果
	 */
	public int insertMallUser(MallUser mallUser);

	/**
	 * 修改用户
	 *
	 * @param mallUser
	 *            用户
	 * @return 结果
	 */
	public int updateMallUser(MallUser mallUser);

	/**
	 * 批量删除用户
	 *
	 * @param ids
	 *            需要删除的用户ID
	 * @return 结果
	 */
	public int deleteMallUserByIds(ReqIdsParam ids);

	/**
	 * 删除用户信息
	 *
	 * @param id
	 *            用户ID
	 * @return 结果
	 */
	public int deleteMallUserById(ReqIdParam id);

	/**
	 * 设置支付密码
	 */
	HttpResult<Boolean> payPassword(String payPassword, LoginUser loginUser);

	HttpResult<String> signOut(LoginUser loginUser);

	/**
	 * 消息推送
	 * @param messagePO
	 * @return
	 */
	HttpResult<Boolean> pushMessage(MallMessageDTO messagePO);

	HttpResult<ResOpenUserInfoVO> info(LoginUser loginUser);

	HttpResult<List<MallUser>> newUser(MallUser mallUser);
	/**
	 * 根据省市区模糊查询该地区所有用户
	 */
	HttpResult<List<MallUser>> pushAddressMessage(MallMessageDTO messagePO);

	/**
	 * 查询用户是否有上级用户
	 * @param upUuid
	 * @return
	 */
	List<MallUser> selectOneByUuid(Long upUuid);

	/**
	 * 组织架构第一次查询没有上级用户id的用户
	 */
	List<MallUser> selectALLOneByUuid();

	/**
	 * 查询用户是否有上级用户
	 * @param upUuid
	 * @return
	 */
	MallUser selectmobileByUuid(Long upUuid);

	/**
	 * 查询非合伙人用户
	 * @return 非合伙人用户
	 */
	List<MallUser> selectpartner();

	/**
	 * 查询非供应商用户
	 * @return 非合伙人用户
	 */
	List<MallUser> selectSupplier();


	/**
	 * 查询所有用户
	 */
	List<MallUser> userList();

	/**
	 * 查询用户是否有上级用户
	 * @param uuid
	 * @return
	 */
	MallUser selectmobileByid(Long uuid);

	/**
	 * 生成用户唯一UUID
	 * @return 用户唯一ID
	 */
	int generateUUID();


	List<MallUser> queryMyTeam(Long uuid);

	AppMyTeamInfoVO appSelectTeam(LoginUser loginUser);

    int editMallUser(MallUser mallUser);

	MallUserStaticsVo queryUserStatistics();

	List<MallUser> selectOneByUuidDown(Long upUuid);

	Long selectApprovalStatus(Long uuid);

	Long selectStoreApprovalStatus(Long uuid);


    BigDecimal waitGoodsRoll();

	BigDecimal goodsRoll();


	Page<AccountMyTeamVo> appSelectOneTeam(ReqPageParam param, Long uuid);
}
